//token操作 存储/获取/删除


/* 存储token */
const TT_TOKEN = 'token';
export const setToken = (token) => localStorage.setItem(TT_TOKEN , token);

/* 获取token */
export const getToken = () => localStorage.getItem(TT_TOKEN);

/* 删除token */
export const removeToken = () => localStorage.removeItem(TT_TOKEN);



/* 储存已关注栏目数据 */
const TT_FOLLOW_CATEGORY = 'FOLLOW_CATEGORY';
export const setCate = (cate) => localStorage.setItem(TT_FOLLOW_CATEGORY , JSON.stringify(cate));

/* 获取已关注栏目数据 */
export const getCate = () => JSON.parse(localStorage.getItem(TT_FOLLOW_CATEGORY));

/* 删除已关注栏目数据 */
export const removeCate = () => localStorage.removeItem(TT_FOLLOW_CATEGORY);



/* 储存未关注栏目数据 */
const TT_UNFOLLOW_CATEGORY = 'UNFOLLOW_CATEGORY';
export const setUnCate = (cate) => localStorage.setItem(TT_UNFOLLOW_CATEGORY , JSON.stringify(cate));

/* 获取未关注栏目数据 */
export const getUnCate = () => JSON.parse(localStorage.getItem(TT_UNFOLLOW_CATEGORY));

/* 删除未关注栏目数据 */
export const removeUnCate = () => localStorage.removeItem(TT_UNFOLLOW_CATEGORY);


/* 用户ID储存 */
const USER_ID = 'USER_ID';

export const setID = (id) => localStorage.setItem(USER_ID , id);

export const getID = () => localStorage.getItem(USER_ID);

export const removeID = () => localStorage.removeItem(USER_ID);


/* 用户搜索关键字 */
const SEARCH_KEY = 'SEARCH_KEY';

export const setSEARCH_KEY = (searchList) => localStorage.setItem(SEARCH_KEY , JSON.stringify(searchList));

export const getSEARCH_KEY = () => JSON.parse(localStorage.getItem(SEARCH_KEY));

export const removeSEARCH_KEY = () => localStorage.removeItem(SEARCH_KEY);
